<head>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
    <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
    <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>
    <script type="text/javascript"
            src="<%=request.getContextPath()%>/script/createquestion.js"></script>
    <script type="text/javascript"
            src="<%=request.getContextPath()%>/script/datecheck.js"></script>
	<script type="text/javascript"
			src="<%=request.getContextPath()%>/script/rte.js"></script>
	<script type="text/javascript">
	$(document).ready(function() {
		$(".rte_editor").RTE('${question.text}', '<%=request.getContextPath()%>/images/rte/');
	});
	</script>

<style type="text/css" media="all">
.rte_box { width:230px; height:226px; padding:0px 3px; margin:0px auto; /*border:#FF9900 1px solid;*/}
.rte_box iframe{ margin:0px; padding:0px; width:230px; height:226px; border:1px;}
.bar{ margin:0px auto; padding:0px 3px; height:25px; width:240px; font-size:14px;}

.bar ul{
	border:#FFFFFF 1px solid;
	background-color:#E6E6E6;
	cursor:pointer;
	height:25px;
	font-size:12px;
	margin: 0px;
	padding: 0px;
}

li {
	list-style-type: none;
}

.bar ul li {
	float: left;
	height: 20;
}

.bar ul li a {
	display: block;
	height: 20;
	border: 0px;
	text-decoration: none;
}

.bar ul li a img{
	border: 0px;
	/*text-decoration: none;*/
}
</style>
</head>
<body>
    <!-- Menu -->
    <jsp:include page="menu.jsp" />

    <!--START: Subnav -->
    <div class="sub_nav">
        <ul>
            <li>
                <a href="#"><img src="<%=request.getContextPath()%>/images/menu/sub_general_on.gif"
                                     width="114" height="18" alt="gernal" />
                </a>
            </li>
        </ul>
    </div>
    <!--END: Subnav -->

    <!--START: content -->
    <div class="content2">
        <div class="insider">
            <div class="corners">
                <div class="corners_top"></div>
                <form id="question" method="post">
                    <input type="hidden" id="submitAction" name="submitAction" />
                    <div class="column1">
                        <div class="col_l">
                            <table width="440" border="0" cellspacing="4"
                                   class="formlayout_table">
                                <tr>
                                    <th width="188">
                                        <label>
                                            <spring:message code="question.id" />:
                                        </label>
                                    </th>
                                    <td width="240">
                                        ${question.refId}
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        <label>
                                            <spring:message code="question.version" />:
                                        </label>
                                    </th>
                                    <td>
                                        ${question.version}
                                        <br />
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        <label>
                                            Name:
                                        </label>
                                    </th>
                                    <td class="bg_n">
                                        <input name="name" id="name" type="text" class="input3" maxlength="255" value="${question.name}"/>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        <label>
                                            Vocabulary Name:
                                        </label>
                                    </th>
                                    <td class="bg_n">
                                        <input name="vocabularyname" id="vocabularyname" type="text" class="input3" maxlength="255" value="${question.vocabularyname}"/>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        <label>
                                            <spring:message code="question.text" />:
                                        </label>
                                    </th>
                                    <td class="bg_n">
                                        <textarea name="text" id="text" class="textarea2 rte_editor" style="height:9em;display:none" onkeypress="if(this.value.length >=1999) return false;" onpaste="if(this.value.length >=1999) return false;"></textarea>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        <label>
                                            <spring:message code="question.description" />:
                                        </label>
                                    </th>
                                    <td class="bg_n">
                                        <textarea name="description" id="description" class="textarea2" onkeypress="if(this.value.length >=255) return false;" onpaste="if(this.value.length >=255) return false;">${question.description}</textarea>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        <label>
                                            <spring:message code="question.helptext" />:
                                        </label>
                                    </th>
                                    <td class="bg_n">
                                        <textarea name="helpText" id="helpText" cols="50" rows="15" class="textarea2" onkeypress="if(this.value.length >=255) return false;" onpaste="if(this.value.length >=255) return false;">${question.helpText}</textarea>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <table width="283" border="0" cellspacing="4"
                               class="formlayout_table fr">
                            <tr>
                                <th width="159">
                                    <label>
                                        <spring:message code="question.siblingid" />:
                                    </label>
                                </th>
                                <td width="111">
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        <spring:message code="question.siblingversion" />:
                                    </label>
                                </th>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        <spring:message code="question.status" />:
                                    </label>
                                </th>
                                <td>
                                    ${question.questionStatusType.code}
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        <spring:message code="question.availability" />:
                                    </label>
                                </th>
                                <td>
                                    ${question.questionAvailabilityType.code}
                                </td>
                            </tr>
                            <tr>
                                <th><label><spring:message code="application.lastmodifieddate" />:</label></th>
                                <td></td>
                            </tr>
                            <tr>
                                <th><label><spring:message code="application.lastmodifiedby" />:</label></th>
                                <td></td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        <spring:message code="question.retiredby" />:
                                    </label>
                                </th>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        <spring:message code="question.retireddate" />:
                                    </label>
                                </th>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                            <tr>
                                <th>
                                    <label>
                                        <spring:message code="question.retirednotes" />:
                                    </label>
                                </th>
                                <td>
                                    &nbsp;
                                </td>
                            </tr>
                        </table>
                        <table width="750" border="0" cellspacing="4"
                               class="formlayout_table cb">
                            <tr>
                                <th width="190" ><label><spring:message code="question.responsetype" />:</label></th>
                                <td width="543" class="bg_n radio_button">
                                    <select name="Responsetype" id="Responsetype"
                                            onchange="ChangeType(this.options[this.selectedIndex].text)">
                                        <option value="0" <c:if test="${Responsetype=='0'}">selected</c:if> >
                                            Please Select
                                        </option>
                                        <option value="Custom" <c:if test="${Responsetype=='Custom'}">selected</c:if>>
                                            Custom
                                        </option>
                                        <option value="Dynamic" <c:if test="${Responsetype=='Dynamic'}">selected</c:if>>
                                            Dynamic
                                        </option>
                                        <c:forEach var="restype" items="${restype}">
                                            <option value="${restype.responseTypeId}" <c:if test="${restype.responseTypeId eq Responsetype}">selected</c:if>>
                                                ${restype.name}
                                            </option>
                                        </c:forEach>
                                    </select>
                                </td>
                            </tr>
                        </table>
                        <div id="div_custom" style="display:none;">
                            <table width="750" border="0" cellspacing="4" class="formlayout_table cb">
                                <tr>
                                    <th width="190"><label>UI Control:</label></th>
                                    <td width="270" class=" bg_n radio_button">
                                        <select name="Custom_UIControl" id="Custom_UIControl" onchange="ChangeTypeBy(this.options[this.selectedIndex].text)">
                                            <option value="0">
                                                Please Select
                                            </option>
                                            <c:forEach var="custom_uicontrol" items="${custom_uicontrol}">
                                                <option value="${custom_uicontrol.name}">
                                                    ${custom_uicontrol.name}
                                                </option>
                                            </c:forEach>
                                        </select>
                                    </td>
                                    <th width="160"><label id="Custom_DataType_label">Data Type:</label></th>
                                    <td width="110" class="bg_n radio_button">
                                        <select name="Custom_DataType" id="Custom_DataType" onchange="ChangeCustomBy(this.options[this.selectedIndex].text)">
                                            <option value="0">
                                                Please Select
                                            </option>
                                            <c:forEach var="datatype" items="${datatype}">
                                                <option value="${datatype.code}">
                                                    ${datatype.name}
                                                </option>
                                            </c:forEach>
                                        </select>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div id="div_dynamic" style="display:none;">
                            <table width="750" border="0" cellspacing="4" class="formlayout_table cb">
                                <tr>
                                    <th width="190"><label>UI Control:</label></th>
                                    <td width="270" class=" bg_n radio_button">
                                        <select name="Dynamic_UIControl" id="Dynamic_UIControl" onchange="ChangeTypeBy(this.options[this.selectedIndex].text)">
                                            <option value="0">
                                                Please Select
                                            </option>
                                            <c:forEach var="dynamic_uicontrol" items="${dynamic_uicontrol}">
                                                <option value="${dynamic_uicontrol.name}">
                                                    ${dynamic_uicontrol.name}
                                                </option>
                                            </c:forEach>
                                        </select>
                                    </td>
                                    <th width="160"><label id="Dynamic_DataType_label">Data Type:</label></th>
                                    <td width="110" class="bg_n radio_button">
                                        <select name="Dynamic_DataType" id="Dynamic_DataType">
                                            <option value="0">
                                                Please Select
                                            </option>
                                            <c:forEach var="datatype" items="${datatype}">
                                                <option value="${datatype.code}">
                                                    ${datatype.name}
                                                </option>
                                            </c:forEach>
                                        </select>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div id="div_none" style="display:none;">

                        </div>
                        <div id="div_checkbox" style="display:none;">
                            <table width="750" border="0" cellspacing="4" class="formlayout_table cb">
                                <tr>
                                    <th>&nbsp;</th>
                                    <td class="response_type_check"><dl class="edit">
                                    </dl></td>
                                </tr>
                                <tr>
                                    <th>
                                        &nbsp;
                                    </th>
                                    <td class="response_type_input">
                                        <input id="resp_id_check" type="hidden" value="" />
                                        <input id="resp_label_check" type="text" class="label" maxlength="220"/>
                                        <input id="resp_value_check" type="text" class="value" maxlength="220"/>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        &nbsp;
                                    </th>
                                    <td align="right">
                                        <img src="<%=request.getContextPath()%>/images/btn/btn_delete.gif" width="76" height="23"
                                             class="btn" id="delresp_check"/>
                                        <img src="<%=request.getContextPath()%>/images/btn/btn_move_up.gif" width="123" height="23"
                                             class="btn" id="moveup_check"/>
                                        <img src="<%=request.getContextPath()%>/images/btn/btn_move_down.gif" width="122" height="23"
                                             class="btn" id="movedown_check"/>
                                        <img src="<%=request.getContextPath()%>/images/btn/btn_update.gif" width="81" height="23"
                                             class="btn" id="addresp_check"/>
                                        <img src="<%=request.getContextPath()%>/images/btn/btn_add.gif" width="59" height="23"
                                             class="btn" id="addresp_check_add"/>
                                    </td>
                                </tr>
                                <tr>
                                    <th><label>Entries:</label></th>
                                    <td><input type="text" id="entries_value_check" size="2" readonly="readonly" style="border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px"/></td>
                                </tr>
                                <tr>
                                    <th width="190"><label>Max Selections:</label></th>
                                    <td width="543"><input name="maxResponses_sq_checkbox" id="maxResponses_sq_checkbox" type="text" maxlength="255"/></td>
                                </tr>
                            </table>
                        </div>
                        <div id="div_radiobutton" style="display:none;">
                            <table width="750" border="0" cellspacing="4" class="formlayout_table cb">
                                <tr>
                                    <th width="190">&nbsp;</th>
                                    <td class="response_type"><dl class="edit">
                                    </dl></td>
                                </tr>
                                <tr>
                                    <th>
                                        &nbsp;
                                    </th>
                                    <td class="response_type_input">
                                        <input id="resp_id" type="hidden" value="" />
                                        <input id="resp_label" type="text" class="label" maxlength="220"/>
                                        <input id="resp_value" type="text" class="value" maxlength="220"/>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        &nbsp;
                                    </th>
                                    <td align="right">
                                        <img src="<%=request.getContextPath()%>/images/btn/btn_delete.gif" width="76" height="23"
                                             class="btn" id="delresp"/>
                                        <img src="<%=request.getContextPath()%>/images/btn/btn_move_up.gif" width="123" height="23"
                                             class="btn" id="moveup"/>
                                        <img src="<%=request.getContextPath()%>/images/btn/btn_move_down.gif" width="122" height="23"
                                             class="btn" id="movedown"/>
                                        <img src="<%=request.getContextPath()%>/images/btn/btn_update.gif" width="81" height="23"
                                             class="btn" id="addresp"/>
                                        <img src="<%=request.getContextPath()%>/images/btn/btn_add.gif" width="59" height="23"
                                             class="btn" id="addresp_add"/>
                                    </td>
                                </tr>
                                <tr>
                                    <th><label>Entries:</label></th>
                                    <td><input type="text" id="entries_value" size="6" readonly="readonly" style="border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px"/></td>
                                </tr>
                            </table>
                        </div>
                        <div id="div_dropdown" style="display:none;">
                            <table width="750" border="0" cellspacing="4" class="formlayout_table cb">
                                <tr>
                                    <th width="190">&nbsp;</th>
                                    <td class="response_type_dropdown" ><dl class="edit">
                                    </dl></td>
                                </tr>
                                <tr>
                                    <th>
                                        &nbsp;
                                    </th>
                                    <td class="response_type_input">
                                        <input id="resp_id_dropdown" type="hidden" value="" />
                                        <input id="resp_label_dropdown" type="text" class="label" maxlength="220"/>
                                        <input id="resp_value_dropdown" type="text" class="value" maxlength="220"/>
                                    </td>
                                </tr>
                                <tr>
                                    <th>
                                        &nbsp;
                                    </th>
                                    <td align="right">
                                        <img src="<%=request.getContextPath()%>/images/btn/btn_delete.gif" width="76" height="23"
                                             class="btn" id="delresp_dropdown"/>
                                        <img src="<%=request.getContextPath()%>/images/btn/btn_move_up.gif" width="123" height="23"
                                             class="btn" id="moveup_dropdown"/>
                                        <img src="<%=request.getContextPath()%>/images/btn/btn_move_down.gif" width="122" height="23"
                                             class="btn" id="movedown_dropdown"/>
                                        <img src="<%=request.getContextPath()%>/images/btn/btn_update.gif" width="81" height="23"
                                             class="btn" id="addresp_dropdown"/>
                                        <img src="<%=request.getContextPath()%>/images/btn/btn_add.gif" width="59" height="23"
                                             class="btn" id="addresp_dropdown_add"/>
                                    </td>
                                </tr>
                                <tr>
                                    <th><label>Entries:</label></th>
                                    <td><input type="text" id="entries_value_dropdown" size="6" readonly="readonly" style="border-style: solid; border-top-width: 0px; border-right-width: 0px; border-bottom-width: 0px; border-left-width: 0px"/></td>
                                </tr>
                            </table>
                        </div>
                        <div id="div_textarea" style="display:none;">
                            <table width="750" border="0" cellspacing="4" class="formlayout_table">
                                <tr>
                                    <th width="190"><label>Columns:</label></th>
                                    <td width="543"><input name="width" id="width" type="text" class="input3" maxlength="255"/></td>
                                </tr>
                                <tr>
                                    <th><label>Rows:</label></th>
                                    <td><input name="rows" type="text" id="rows" class="input3" maxlength="255"/></td>
                                </tr>
                                <tr>
                                    <th><label>Minimum Chars:</label></th>
                                    <td><input name="minResponseValue_sq_textarea" id="minResponseValue_sq_textarea" type="text" class="input3" maxlength="255"/></td>
                                </tr>
                                <tr>
                                    <th><label>Maximum Chars:</label></th>
                                    <td><input name="maxResponseValue_sq_textarea" id="maxResponseValue_sq_textarea" type="text" class="input3" maxlength="255"/></td>
                                </tr>
                                <tr>
                                    <th><label>Edit Mask:</label></th>
                                    <td><select name="Mask_textarea" class="select1">
                                            <option value="0">
                                                Please Select
                                            </option>
                                            <c:forEach var="datavilidate" items="${datavilidate}">
                                                <option value="${datavilidate.code}">
                                                    ${datavilidate.description}
                                                </option>
                                            </c:forEach>
                                        </select>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div id="div_string" style="display:none;">
                            <table width="750" border="0" cellspacing="4" class="formlayout_table">
                                <tr>
                                    <th><label>Width(in pixels):</label></th>
                                    <td><input name="width_string" type="text" id="width_string" class="input3" maxlength="255"/></td>
                                </tr>
                                <tr>
                                    <th><label>Minimum Chars:</label></th>
                                    <td><input name="minResponseValue_sq_string" id="minResponseValue_sq_string" type="text" class="input3" maxlength="255"/></td>
                                </tr>
                                <tr>
                                    <th><label>Maximum Chars:</label></th>
                                    <td><input name="maxResponseValue_sq_string" id="maxResponseValue_sq_string" type="text" class="input3" maxlength="255"/></td>
                                </tr>
                                <tr>
                                    <th width="190"><label>Units:</label></th>
                                    <td width="543">
                                        <input name="Units_string" id="Units_string" type="text" class="input3" maxlength="28"/>
                                        
                                    </td>
                                </tr>
                                <tr>
                                    <th><label>Edit Mask:</label></th>
                                    <td><select name="Mask_string" class="select1">
                                            <option value="0">
                                                Please Select
                                            </option>
                                            <c:forEach var="datavilidate" items="${datavilidate}">
                                                <option value="${datavilidate.code}">
                                                    ${datavilidate.description}
                                                </option>
                                            </c:forEach>
                                        </select>
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div id="div_float" style="display:none;">
                            <table width="750" border="0" cellspacing="4" class="formlayout_table">
                                <tr>
                                    <th width="190"><label>Minimum Value:</label></th>
                                    <td width="543"><input name="minResponseValue_sq_float" id="minResponseValue_sq_float" type="text"class="input3" maxlength="255"/></td>
                                </tr>
                                <tr>
                                    <th><label>Maximum Value:</label></th>
                                    <td><input name="maxResponseValue_sq_float" type="text" id="maxResponseValue_sq_float" class="input3" maxlength="255"/></td>
                                </tr>
                                <tr>
                                    <th><label>Significant Digits:</label></th>
                                    <td><input name="maxResponses_sq_float" id="maxResponses_sq_float" type="text" class="input3" maxlength="255"/></td>
                                </tr>
                                <tr>
                                    <th><label>Units:</label></th>
                                    <td>
                                        <input name="Units_float" id="Units_float" type="text" class="input3" maxlength="28"/>
                                        
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div id="div_int" style="display:none;">
                           <table width="750" border="0" cellspacing="4" class="formlayout_table">
                               <tr>
                                    <th width="190"><label>Minimum Value:</label></th>
                                    <td width="543"><input name="minResponseValue_sq_int" id="minResponseValue_sq_int" type="text"class="input3" maxlength="255"/></td>
                                </tr>
                                <tr>
                                    <th><label>Maximum Value:</label></th>
                                    <td><input name="maxResponseValue_sq_int" type="text" id="maxResponseValue_sq_int" class="input3" maxlength="255"/></td>
                                </tr>
                                <tr>
                                    <th><label>Units:</label></th>
                                    <td>
                                        <input name="Units_int" id="Units_int" type="text" class="input3" maxlength="28"/>
                                       
                                    </td>
                                </tr>
                            </table>
                        </div>
                        <div id="div_date" style="display:none;">
                            <table width="750" border="0" cellspacing="4" class="formlayout_table">
                                <tr>
                                    <th width="190"><label>Minimum Value:</label></th>
                                    <td width="543"><input name="minResponseValue_sq_date" id="minResponseValue_sq_date" type="text" class="input3" maxlength="255"/></td>
                                </tr>
                                <tr>
                                    <th><label>Maximum Value:</label></th>
                                    <td><input name="maxResponseValue_sq_date" id="maxResponseValue_sq_date" type="text" class="input3" maxlength="255"/></td>
                                </tr>
                            </table>
                        </div>
                        <div id="div_display" style="display:none;">
                            <table width="750" border="0" cellspacing="4" class="formlayout_table">
                                <tr>
                                    <th width="190"><label>Display Width:</label></th>
                                    <td width="543"><input name="display_width" id="display_width" type="text" class="input3" maxlength="100"/></td>
                                </tr>                                
                            </table>
                        </div>
                    </div>
                </form>
                <ul class="functions1">
                    <li>
                        <a href="#" onclick="jumpAction('SUBMIT');"><img src="<%=request.getContextPath()%>/images/btn/functions1/btn_save.gif"
                                                                             width="122" height="23" class="btn" />
                        </a>
                    </li>
                    <li>
                        <a href="#" onclick="jumpAction('SUBMIT_AND_EXIT');"><img src="<%=request.getContextPath()%>/images/btn/functions1/btn_save_exit.gif"
                                                                                      width="122" height="23" class="btn" />
                        </a>
                    </li>
                    <li>
                        <a href="#" onclick="jumpAction('SUBMIT_AND_NEW');"><img
                                src="<%=request.getContextPath()%>/images/btn/functions1/btn_save_create_new.gif" alt=""
                                width="122" height="41" class="btn" />
                        </a>
                    </li>
                    <li>
                        <a href="list.html?from=cancel&checkSearch=list"><img src="<%=request.getContextPath()%>/images/btn/functions1/btn_cancel.gif"
                                                                 alt="" width="122" height="23" class="btn" />
                        </a>
                    </li>
                </ul>
                <div class="corners_bottom"></div>

            </div>

            <div class="message">
                ${questionerror}
                ${empty questionerror ? "" : "<br />"}
                ${questionmessage}
                ${empty questionmessage ? "" : "<br />"}
                <jsp:include page="validateMessage.jsp" />
            </div>
        </div>
    </div>
    <!--END: content -->

    <!--START: Footer -->
    <div class="footer"></div>
    <!--END: Footer -->
</body>